<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
  $(function() {
    mallShopSettlementDetailsListModule.init();
  });

  var mallShopSettlementDetailsListModule = (function(){

    var module = {
      init : function(){

      },
      //提前结算
      confirmSettlement : function(id){
        var url = 'mallShopSettlementController.do?confirmSettlement&id='+id+'&shopId=${shopId}';
        createdialog('确认结算 ', '确定同意该商家的提前结算申请 ?', url, 'mallShopSettlementDetailsList');
      },
      detailsexportFile : function(){
        window.location.href = 'mallShopSettlementController.do?detailsexport&shopId=${shopId}&'+$("#mallShopSettlementDetailsListForm").serialize();
      }

    }
    return module;
  })();
</script>



<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
    <t:datagrid name="mallShopSettlementDetailsList" title="结算清单" actionUrl="mallShopSettlementController.do?detailsdatagrid&shopId=${shopId}"
                idField="id" fit="true" queryMode="group" autoLoadData="true" >
      <t:dgCol title="编号" field="id" hidden="true" ></t:dgCol>
      <t:dgCol title="结算状态" field="settlementStatus"   query="true" replace="未结算_0,已结算_1"  width="100"></t:dgCol>
      <t:dgCol title="提前结算" field="auditStatus"  hidden="true" query="true" replace="未申请_0,审核中_1,已通过_2"  width="100"></t:dgCol>
      <t:dgCol title="订单号" field="orderNo"   width="220"></t:dgCol>
      <t:dgCol title="下单时间" field="orderCreateTime"   formatter="yyyy-MM-dd hh:mm:ss" width="210" ></t:dgCol>
      <t:dgCol title="交易完成时间" field="orderFinishedTime"  formatter="yyyy-MM-dd hh:mm:ss"  width="210"  ></t:dgCol>
      <t:dgCol title="账单周期(天)" field="settleDayCount"   width="120"></t:dgCol>
      <t:dgCol title="结算日期" field="settlementTime"  formatter="yyyy-MM-dd hh:mm:ss"  width="210"></t:dgCol>
      <t:dgCol title="交易总金额" field="orderMoney"   width="120"></t:dgCol>
      <t:dgCol title="结算金额" field="settlementMoney" width="120"></t:dgCol>
      <t:dgCol title="交易服务费" field="settlementExpenses"  width="120"></t:dgCol>
      <t:dgCol title="提前结算服务费" field="settlementExpensesAdvance" width="120"></t:dgCol>
      <t:dgCol title="申请结算人" field="applyUserName"  width="120"></t:dgCol>
      <t:dgCol title="申请结算日期" field="applyTime"  formatter="yyyy-MM-dd hh:mm:ss" width="210"></t:dgCol>
      <t:dgCol title="审核状态" field="auditStatusName" width="120"></t:dgCol>
      <t:dgCol title="结算人" field="settleUserName"  width="120"></t:dgCol>
      <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
      <t:dgFunOpt funname="mallShopSettlementDetailsListModule.confirmSettlement(id)" title="同意提前结算" exp="auditStatus#eq#1"></t:dgFunOpt>
      <t:dgToolBar  title="导出" icon="icon-putout" funname="mallShopSettlementDetailsListModule.detailsexportFile"></t:dgToolBar>
    </t:datagrid>
  </div>
</div>